<template>
  <div class="dispatcherCountsContainer">
    <div>
      <div class="title-bar">
        <span class="text">出车次数TOP10</span>
      </div>
      <div class="d-flex jc-center body-box">
        <dv-scroll-board class="dv-scr-board" :config="config" />
      </div>
    </div>
  </div>
</template>

<script>

export default {
  props: {
    tableData: {
      type: Array,
      default: () => []
    }
  },
  data() {
    return {
      config: {
        header: ['车组名', '次数'],
        data: this.tableData,
        rowNum: 6, //表格行数
        headerHeight: 40,
        headerBGC: 'rgba(67, 148, 228, 0.3)', //表头
        oddRowBGC: '#0f1325', //奇数行
        evenRowBGC: '#171c33', //偶数行
        index: true,
        columnWidth: [250, 250, 250],
        indexHeader: '序号',
        align: ['center', 'center', 'center']
      }
    }
  },
  watch: {
    tableData(newVal) {
      this.config.data = newVal;
    }
  }
};
</script>

<style lang="scss" scoped>
$box-height: 100%;
$box-width: 100%;
.dispatcherCountsContainer {
  padding: 5px 0px 0px 25px;
  height: $box-height;
  width: $box-width;
  border-radius: 5px;
  .title-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px;
    font-size: 16px;
  }
  .text {
    color: #3DE7C9;
  }
  .body-box {
    border-radius: 10px;
    overflow: hidden;
    .dv-scr-board {
      width: 100%;
      height: 280px;
    }
  }
}
</style>
